﻿using Architecture.Domain.Service;
using MediatR;
using RBAC.ZhuBoLin.Application.Command.RoleCommand;

namespace RBAC.ZhuBoLin.Application.CommandHandlers.RoleHandler
{
    public class PicDeleteCommandHandler : IRequestHandler<PicDeleteCommand, int>
    {
        protected readonly IAllPicService allPicService;

        public PicDeleteCommandHandler(IAllPicService allPicService)
        {
            this.allPicService = allPicService;
        }

        public async Task<int> Handle(PicDeleteCommand request, CancellationToken cancellationToken)
        {
            return await allPicService.DeletePic(request.id);
        }
    }
}
